This Genie will replace each box at a particular position on a range of pages. You will be prompted to select the box which occurs at a position on the range of pages.
The box you click on will replace all boxes in the page range which are in exactly the same position, as defined by the top left corner.
Written by Don Cox May '92
*/
cr = '0a'x
pageopts = "OODDEEVENAALL"
address command
call SafeEndEdit.rexx()
call ppm_AutoUpdate(0)
counter = 0
signal on error
signal on syntax
boxpos = ppm_GetClickPosition("Click on box to be copied to each page")
originalpage = ppm_CurrentPage()
boxtop = word(boxpos, 2)
boxleft = word(boxpos, 1)
box = ppm_BoxAtPosn(boxleft, boxtop)
if box = 0 then exit_msg()
if upper(word(ppm_GetBoxInfo(box), 1)) = "TEXT" & ppm_TextOverFlow(box) then
text = ppm_GetArticleText(box,1)
else
text = ''
docstart = ppm_DocFirstPage()
docend = ppm_DocLastPage()
pages = upper(ppm_GetForm("Enter range of pages", 20, "From:"docstart'0a'x "To:"docend'0a'x "ODD/EVEN/ALL"))
if pages = '' then exit_msg()
parse var pages startpage '0a'x endpage '0a'x pageopt
if (startpage ~= '' & datatype(startpage) ~= NUM) | (endpage ~= '' & datatype(endpage) ~= NUM ) then exit_msg("Invalid Input")
increment = 1
/*
* Check error conditions
*/
if startpage < docstart then exit_msg('Invalid Range')
else if startpage > docend then exit_msg('Invalid Range')
if endpage < docstart then exit_msg('Invalid Range')
else if endpage > docend then exit_msg('Invalid Range')
if endpage < startpage then exit_msg('Invalid Range')
if pageopt = 'ALL' | pageopt = 'A' then
do
increment = 1
end
else if pageopt = 'EVEN' | pageopt = 'E' then
do
increment = 2
if (startpage // 2) then startpage = startpage + 1
end
else if pageopt = 'ODD' | pageopt = 'O' then
do
increment = 2
if ~(startpage // 2) then startpage = startpage + 1